#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "fn_loadAmmoBox.sqf"
#include <btc_macros.h>
TRACE_1("Start",_this);

private ["_vec","_boxes","_box"];
DEFAULT_PARAM(_vec,0,objNull);

if (IS_OBJECT(_vec) && {!(isNull _vec)}) then {
	_boxes = nearestObjects [_vec, BTC_Ammo_Box_TypeList, 8];
	{
		_box = _x;
		if (_box getVariable ["BTC_AMMO_BOX",false]) exitWith {
			TRACE_1("Ammo Box Found",_box);
			_vec setVariable ["BTC_AMMO_LOADED",true,true];
			deleteVehicle _box;
			hint (localize "STR_BTC_AMMO_LOADED");
		};
	} foreach _boxes;
};
